An Algebraic Specification of a Transformation Tool for Prolog Programs
نویسندگان
چکیده
The paper reports about a case study in algebraic specification. It describes TransLog, a transformation tool for pure Prolog programs. TransLog supports the interactive transformation of (a part of) a program. Six transformation steps are supported: unfolding, folding, goal definition, argument permutation (an instance of goal replacement), goal switching and definition elimination. As much as possible, pure Prolog semantics are preserved. The tool is equipped with navigation options, which allow the user to switch from the current program to another program in a transformation sequence. TransLog has been implemented with the ASF+SDF Meta-environment. The paper focuses on the algebraic specification of the tool, not on the underlying theory of (logic) program transformation. The specification is presented at a global level, only the specification of the unfold and fold step is discussed more in depth.
منابع مشابه
A tool to check operational properties of Prolog programs with application to program construction and program optimization – Tool demonstration
We present a tool, based on abstract interpretation, that checks the correctness of an annotated Prolog program with respect to formal specifications of its procedures. Specifications describe operational properties such as mode, type, sharing, linearity, and size of input/output terms, occur-check freeness, conditions for sure success and failure, number of solutions to a call, including deter...
متن کاملFormal Specification and Prototyping of a Program Specializer
This paper reports on the use of formal specifications in the development of a software maintenance tool for specializing imperative programs, which have become very complex due to extensive modifications. The tool is specified in terms of inference rules and operates by induction on the abstract syntax. The correctness of these rules is proved using rule induction. A Prolog prototype has been ...
متن کاملAn Algebraic Approach to Meta-level Programming in Prolog
Meta-level programming is used in Prolog when the standard semantics are not suitable for the task at hand: meta-interpreters are meta-programs that direct the execution of other programs and give them 'nonstandard' semantics. Meta-interpretation is inefficient, and program transformation is often preferred: from the initial program meant to be meta-interpreted, a new program is produced (compi...
متن کاملEmbedding Prolog in Haskell
The distinctive merit of the declarative reading of logic programs is the validity of all the laws of reasoning supplied by the predicate calculus with equality Surprisingly many of these laws are still valid for the procedural reading they can therefore be used safely for algebraic manipulation program transformation and optimisation of executable logic programs This paper lists a number of co...
متن کاملTranslating Refined Logic Programs to Mercury
A refinement calculus provides a method for transforming specifications to executable code, maintaining the correctness of the code with respect to its specification. In this paper we investigate the use of Mercury as the target implementation language for a refinement calculus for logic programs. We describe a prototype tool for translating programs in our specification language to Mercury cod...
متن کامل